<?php
class Zend_View_Helper_Highlight extends Zend_View_Helper_Abstract
{
	/**
	 * Method highlight
	 * @param string $haystack
	 * @param string $needle
	 * @return string
	 */
	public function highlight($haystack, $needle)
	{
		$original = $haystack;
		return $haystack;

		/*
		// Convertimos los caracteres especiales (ñ, tildes, etc.)
		$haystack = htmlentities($haystack, ENT_NOQUOTES, 'UTF-8');
		$needle = htmlentities($needle, ENT_NOQUOTES, 'UTF-8');

		if (stripos($haystack, $needle) === false) {
			return $haystack;
		} else {
			$occurrences = array();
			$offset = 0;
			while ($offset = stripos($haystack, $needle, $offset + 1)) {
				$occurrences[] = $offset;
			}
			foreach ($occurrences as $position) {
				$substr1 = substr($haystack, 0, $position);
				$substr2 = substr($haystack, $position, strlen($needle));
				$substr3 = substr($haystack, $position + strlen($needle));
				$haystack = $substr1 . '<strong>' . $substr2 . '</strong>' . $substr3;
				/*
				$string = substr($haystack, $position, strlen($needle));
				$haystack = str_replace($string, '<strong>' . $string . '</strong>', $haystack);
				*
			}
			return html_entity_decode($haystack, ENT_NOQUOTES, 'UTF-8');
		}
		*/
	}

}
